/*
 * Copyright (C) 2018 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.xuexiang.xdlink.component.channel.impl.serialport;

/**
 * 串口参数【串口在Android上,最终走的也是USB】
 *
 * @author xuexiang
 * @since 2018/9/16 下午6:22
 */
public class SerialPortParam {
    /**
     * 串口名
     */
    private String mName;
    /**
     * 串口的波特率
     */
    private int mBaud = 9600;
    /**
     * 串口的数据位
     */
    private byte mDataBits = 8;
    /**
     * 串口的停止位
     */
    private byte mStopBits = 1;
    /**
     * 串口的奇偶校验位
     */
    private byte mParity = 0;
    /**
     * 串口的流控制
     */
    private byte mFlowControl = 0;

    public String getName() {
        return mName;
    }

    public SerialPortParam setName(String name) {
        mName = name;
        return this;
    }

    public int getBaud() {
        return mBaud;
    }

    public SerialPortParam setBaud(int baud) {
        mBaud = baud;
        return this;
    }

    public byte getDataBits() {
        return mDataBits;
    }

    public SerialPortParam setDataBits(byte dataBits) {
        mDataBits = dataBits;
        return this;
    }

    public byte getStopBits() {
        return mStopBits;
    }

    public SerialPortParam setStopBits(byte stopBits) {
        mStopBits = stopBits;
        return this;
    }

    public byte getParity() {
        return mParity;
    }

    public SerialPortParam setParity(byte parity) {
        mParity = parity;
        return this;
    }

    public byte getFlowControl() {
        return mFlowControl;
    }

    public SerialPortParam setFlowControl(byte flowControl) {
        mFlowControl = flowControl;
        return this;
    }
}
